package Dao.impl;

import Dao.BaseDao;
import Dao.PlayListDao;
import pojo.Playlist;

import java.util.List;

public class PlayListDaoImpl extends BaseDao<Playlist> implements PlayListDao {

    @Override
    public boolean addPlayList(int userId, int songId) {
        String sql = "insert into playlists(userId, songId) values(?,?)";
        return update(sql, userId, songId) > 0;
    }

    @Override
    public List<Playlist> selectAllplaylist() {
        String sql = "select songId from playlists";
        return getBeanList(sql);
    }
}
